package zhujie.zhujieConteroll;

import com.example.demo.model.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import zhujie.zhujieservice.RedisService;

import java.util.List;

/**
 * Created by DELL on 2018/12/28.
 */
@RestController
public class Conterollzhujie {
    @Autowired
    private RedisService redisService;

    @PostMapping ("queryall")
    public List<User> getqueryall(){
      return   redisService.queryall();
    }

    @GetMapping  ("queryid")
    public User getqueryall(@RequestParam("id") Integer id){
        return   redisService.queryUserbyid(id);
    }
    @PostMapping("/updateUser")
    public User updateUser(@RequestBody User user){

        return redisService.queryUserbyid(user);
    }
}
